Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

karmadactl cordon&uncordon uses factory to access cluster #2611

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

helen-frank
Copy link
Contributor

Signed-off-by: helen helenfrank@protonmail.com

What type of PR is this?
/kind feature

Which issue(s) this PR fixes:
Part of #2349

Special notes for your reviewer:
Test

 # go run cmd/karmadactl/karmadactl.go --kubeconfig /etc/karmada/karmada-apiserver.config cordon kind-multi-node1                                                                                     [0]
kind-multi-node1 cluster cordoned
 # go run cmd/karmadactl/karmadactl.go --kubeconfig /etc/karmada/karmada-apiserver.config cordon kind-multi-node1                                                                                     [0]
kind-multi-node1 cluster already cordoned
 # go run cmd/karmadactl/karmadactl.go --kubeconfig /etc/karmada/karmada-apiserver.config uncordon kind-multi-node1                                                                                   [0]
kind-multi-node1 cluster uncordoned
 # .go run cmd/karmadactl/karmadactl.go --kubeconfig /etc/karmada/karmada-apiserver.config uncordon kind-multi-node1                                                                                   [0]
kind-multi-node1 cluster already uncordoned

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 3, 2022
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 3, 2022
@helen-frank helen-frank changed the title karmadactl cordon&uncordon uses factory to access cluster [WIP]karmadactl cordon&uncordon uses factory to access cluster Oct 3, 2022
@karmada-bot karmada-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 3, 2022
Signed-off-by: helen <helenfrank@protonmail.com>
@helen-frank helen-frank changed the title [WIP]karmadactl cordon&uncordon uses factory to access cluster karmadactl cordon&uncordon uses factory to access cluster Oct 4, 2022
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 4, 2022
flags.BoolVar(&opts.DryRun, "dry-run", false, "Run the command in dry-run mode, without making any server requests.")
flags.StringVar(defaultConfigFlags.KubeConfig, "kubeconfig", *defaultConfigFlags.KubeConfig, "Path to the kubeconfig file to use for CLI requests.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These code comes multiple times, we may extract them as one function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @carlory can we extract these duplicated codes ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you.

@helen-frank

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll solve this problem after all my pr's are incorporated.

@jwcesign
Copy link
Member

jwcesign commented Oct 9, 2022

other LGTM, cc @lonelyCZ

@wuyingjun-lucky
Copy link
Member

image

It works well on my side

@carlory
Copy link
Member

carlory commented Oct 10, 2022

thanks, I will review it tomorrow.

@carlory
Copy link
Member

carlory commented Oct 13, 2022

Thanks @helen-frank , I just tested it that worked fine.

/lgtm

/cc @lonelyCZ

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 13, 2022
@lonelyCZ
Copy link
Member

Thanks @helen-frank

/approve

/cc @XiShanYongYe-Chang

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
on behalf of @XiShanYongYe-Chang who is on vocation and will get back at the end of this month.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lonelyCZ, RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 13, 2022
@karmada-bot karmada-bot merged commit 3e8ed1d into karmada-io:master Oct 13, 2022
@helen-frank helen-frank deleted the feature/cordonFactory branch October 13, 2022 12:54
RainbowMango added a commit to RainbowMango/karmada that referenced this pull request May 8, 2024
- karmada-io#2611 Remove apiutil.NewDiscoveryRESTMapper, use DynamicRESTMapper by default for cache

Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants